package com.seisys.service.system;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.seisys.dao.DaoSupport;
import com.seisys.util.IData;

@Service("logService")
public class LogService {
	Logger logger = Logger.getLogger(this.getClass());
	@Resource(name = "daoSupport")
	private DaoSupport dao;

	public void save(Map<String, Object> param) {
		try {
			dao.save("OperationLogger.save", param);
		} catch (Exception e) {
			e.printStackTrace();
			logger.info("************操作日志写入异常-开始*************");
			logger.info(param);
			logger.info("************操作日志写入异常-结束*************");
		}
	}

	/*
	 * 列表(全部)
	 */
	@SuppressWarnings("unchecked")
	public List<IData> logList(IData param) throws Exception {
		return (List<IData>) dao.findForList("OperationLogger.logList", param);
	}
}
